Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op-node: Record genesis as being safe from L1 genesis #9684

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

ajsutton
Copy link
Contributor

Description

When the derivation pipeline resets and the safe head is genesis, record that in the safe head database. This allows a node that syncs from genesis (or bedrock activation block) to have a complete safe head database instead of it starting only at the first safe head update.

The L2 genesis is considered to have always been safe since no batch data needs to be read to construct it. Importantly the safe head database entry records the actual L1 genesis block, not the rollup config Genesis.L1 value since the contracts will have been deployed to the L1 before the Genesis.L1 value, potentially allowing dispute games to be created before then and the challenger needs to be able to respond to them. The challenger can only respond if it knows the L2 block that is safe at the game's L1 head. Using the real L1 genesis block as the entry key ensures the L2 genesis is safe for every L1 block and thus every possible dispute game.

Tests

Updated action test.

Updated e2e tests to confirm the challenger can dispute games even for chains where the safe head has never advanced.

Metadata

@ajsutton ajsutton force-pushed the aj/record-safe-genesis branch from 8ea12ae to 9992611 Compare February 28, 2024 02:30
Base automatically changed from aj/restrict-agreed-head to develop February 28, 2024 20:53
@ajsutton ajsutton force-pushed the aj/record-safe-genesis branch from 9992611 to c0e0ff3 Compare February 28, 2024 20:55
Copy link
Contributor

coderabbitai bot commented Feb 28, 2024

Walkthrough

Walkthrough

The recent updates focus on enhancing the handling of safe head updates and reorganizations within the system. This includes adjustments in error handling during block rewinds and replays, initialization changes in faultproof tests, and ensuring the L1 genesis block is always considered safe. Additionally, there's a simplification in the testing setup and the removal of a redundant job from the CI configuration.

Changes

File(s) Summary
.../safedb_test.go Adjusted assertions for safe head records and improved error handling for block rewinds and replays.
.../output_cannon_test.go Modified test initializations by adding withBatcherStopped() and removing unnecessary logic.
.../derive/engine_queue.go Added handling for L2 genesis block being safe, with updates to safe head notifications.
.../derive/engine_queue_test.go Included new expectations for L1 genesis block handling in tests.
.circleci/config.yml Removed go-mod-tidy job from CI configuration.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@ajsutton ajsutton force-pushed the aj/record-safe-genesis branch from c0e0ff3 to 065afd8 Compare February 28, 2024 21:08
op-node/rollup/derive/engine_queue.go Outdated Show resolved Hide resolved
op-node/rollup/derive/engine_queue.go Outdated Show resolved Hide resolved
@ajsutton ajsutton force-pushed the aj/record-safe-genesis branch from 065afd8 to 672bcf9 Compare March 3, 2024 21:08
@ajsutton ajsutton requested a review from trianglesphere March 3, 2024 21:08
@ajsutton ajsutton added this pull request to the merge queue Mar 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 5, 2024
@ajsutton ajsutton added this pull request to the merge queue Mar 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 5, 2024
@ajsutton ajsutton added this pull request to the merge queue Mar 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 5, 2024
@ajsutton ajsutton force-pushed the aj/record-safe-genesis branch from 672bcf9 to 3639c8f Compare March 5, 2024 02:49
@ajsutton ajsutton enabled auto-merge March 5, 2024 02:49
@ajsutton ajsutton force-pushed the aj/record-safe-genesis branch from 3639c8f to 0f06b14 Compare March 5, 2024 03:38
@ajsutton ajsutton requested a review from a team as a code owner March 5, 2024 03:49
@ajsutton ajsutton added this pull request to the merge queue Mar 5, 2024
Merged via the queue into develop with commit c2c92c3 Mar 5, 2024
70 of 72 checks passed
@ajsutton ajsutton deleted the aj/record-safe-genesis branch March 5, 2024 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants